
package ch.hearc.coursJava.moo.thread.addition;

public class RunnableAddition implements Runnable
	{

	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/

	public RunnableAddition(int x, int y)
		{
		this.x = x;
		this.y = y;
		// output
		this.resultat = -1;
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	@Override
	public void run()
		{
		resultat = addition(x,y);
		}

	/*------------------------------*\
	|*				Get				*|
	\*------------------------------*/

	public int getResultat()
		{
		return resultat;
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	private int addition(int x, int y)
		{
		return x + y;
		}

	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/

	// output
	private int resultat;

	//input
	private int x;
	private int y;
	}
